package com.mv.controller;


import com.mv.pojo.Rights;
import com.mv.service.RightsService;
import com.mv.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/mv")
public class RightsController {
    @Autowired
    private RightsService rightsService;
    /*获取左侧列表信息*/
    @GetMapping("/rights/getRightsList")
    public SysResult getRightsList(){
        List<Rights> rightsList = rightsService.getRightsList();
        return SysResult.success(rightsList);
    }
    /*获取列表对应地址*/
    @GetMapping("/rights/getPath")
    public SysResult getPath(String name){
        String path=rightsService.getPath(name);
        return SysResult.success(path);
    }
}
